@model IEnumerable<CrazyToDo.Web.Models.ActivityViewModel>
@{
    ViewData["Title"] = "Activity";
}

<div style="margin:0px 50px 50px 20px">
    @foreach (var item in Model)
    {
        
            <div class="panel panel-primary" style="width:250px;height:130px;float:left;margin:50px 50px 50px 50px;border:none;">
                <div class="panel-heading"style="background:rgb(240, 244, 247);color:black;border:none;">
                    <h3 class="panel-title" style="text-align:center">@item.Theme</h3>
                </div>
                <div class="panel-body" style="text-align:center">
                    @item.Content
                </div>
                <div>
                    <form action="/Activity/Join" method="post">
                        <button type="submit" name="ActivityId" value="@item.Id" class="btn btn-primary btn-xs " style="position:relative;left:205px;top:11px;background:rgb(240, 244, 247);color:black;border:none;">
                            参与
                        </button>
                    </form>
                </div>
            </div>
             
    }
        
    <div>      
        <img src="~/Home/img/加号.png" data-toggle="modal" data-target="#myModal" style="outline:none;background:none;border:none;margin:140px 20px 0px 100px;cursor:pointer;float:left" />
        <!-- 模态框（Modal） -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <form action="/Activity/Add" method="post">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                &times;
                            </button>
                            <h4 class="modal-title" id="myModalLabel">
                                活动
                            </h4>
                        </div>
                        <div class="modal-body">
                            <div class="form-group">
                                <label for="name">主题</label>
                                <input type="text" class="form-control" name="Theme"
                                       placeholder="请输入主题" required="required">
                                <label for="name">内容</label>
                                <input type="text" class="form-control" name="Content"
                                       placeholder="请输入内容" required="required">
                                <label for="name">结束时间</label>
                                <input type="date" class="form-control" name="EndTime"
                                       placeholder="请输入时间">
                                <label for="name">参与人数</label>
                                <input type="number" class="form-control" name="PartNumber"
                                       placeholder="请输入人数" required="required">
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">
                                关闭
                            </button>
                            <button type="submit" class="btn btn-primary">
                                添加
                            </button>
                        </div>
                    </form>
                </div><!-- /.modal-content -->
            </div><!-- /.modal -->
        </div>
    </div>

    <div style="clear:both"></div>  
</div>


   


